// 所有路由生效
const { cookRouter } = require('./cook.js')
const { userRouter } = require('./user.js')
const { commonRouter } = require("./common.js")
const { commentRouter } = require('./comment.js')
const { likesRouter } = require('./likes.js')

const routerArr = [cookRouter, userRouter, commonRouter, commentRouter, likesRouter]

const useRouters = (app) => {
  routerArr.forEach(router => {
    app.use(
      router.routes(),
      router.allowedMethods()
    )
  })
}

module.exports = useRouters